<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport">
	<script src="<?php echo base_url().'public/home/js/' ?>jquery.min.js"></script>
	<script src="<?php echo base_url().'public/home/js/' ?>jquery.js"></script>

	
	<link rel="stylesheet" href="<?php echo base_url().'public/home/bootstrap/css/' ?>bootstrap1.min.css">
	<link rel="stylesheet" href="<?php echo base_url().'public/h_ui/lib/Hui-iconfont/1.0.8/' ?>iconfont.css">
	<link rel="stylesheet" href="<?php echo base_url().'public/home/css/' ?>mui.min.css">
	<link rel="stylesheet" href="<?php echo base_url().'public/home/css/' ?>class_assess.css">
	<script type="text/javascript" src="<?php echo base_url().'public/home/js/' ?>class_assess.js"></script>
	<script type="text/javascript" src="<?php echo base_url().'public/home/js/' ?>function.js"></script>	
	<?php include_once "public/home/html/alert.php"  ?>
	<?php include_once "public/home/html/search-select.php"  ?> 
	<script src="https://cdn.staticfile.org/popper.js/1.12.5/umd/popper.min.js"></script>
	<script src="<?php echo base_url().'public/home/bootstrap/js/'?>bootstrap1.min.js"></script>
	<link href="<?php echo base_url().'public/home/bootstrap-select/docs/docs/dist/css/'?>bootstrap-select.min.css" rel="stylesheet" />
	<script src="<?php echo base_url().'public/home/bootstrap-select/docs/docs/dist/js/'?>bootstrap-select.min.js"></script>
	<script src="<?php echo base_url().'public/home/bootstrap-select/docs/docs/dist/js/i18n/'?>defaults-zh_CN.min.js"></script>

	
	<!-- 分页插件 -->
	<?php include_once "public/home/html/step.php"  ?>
	<!-- 图片上传 -->
	<?php include_once "public/home/html/imgupload.php"  ?>

	
	<title>听课评价</title>	
</head>
<body>
	<input type="hidden" class="url" name="url" value="<?php echo base_url(); ?>">
	<input type="hidden" class="url" name="sub_role" value="">
	<input type="hidden" id="is_add" value="<?php echo $is_add?>">
	<!-- <div class="header div_margin" >听课评价</div> -->
	<div class="search-head header mui-bar mui-bar-nav row" style="background-color: #f7f9fa; border:none;">
		<div class="col-xs-1" style="margin-top: 3%">
			<a class=" Hui-iconfont Hui-iconfont-slider-left" href="javascript:void(0)" onclick="history.back();" style="color: #C9C9C9"></a>
		</div>
		<div class="col-xs-11">
			<h1 class="mui-title" style="color:#333;">听课评价</h1>
		</div>
	</div>

	<div id="steps" style="margin-top: 70px"><ul class="progressbar"><li class="active" style="width: 16.6667%;">购买</li><li class="active" style="width: 16.6667%;">付款</li><li class="active" style="width: 16.6667%;">发货</li><li class="active" style="width: 16.6667%;">收货</li><li class="" style="width: 16.6667%;">评价</li><li class="" style="width: 16.6667%;">完成</li></ul></div>

	<script>

		$(function () {
			initStep();
		});

		function initStep() {
			$("#steps").step({
				stepNames: ['课程简要', '教师教学水平', '教学效果评价', '其他', '听课内容记录 ', '完成'],
				initStep: 1
			})
		}

		function previousStep() {
			$("#steps").step("previous");
		}

		function nextStep() {
			$("#steps").step("next");
		}

		function gotoStep(step) {
			$("#steps").step("goto", step)
		}

	</script>
	<input type="hidden" name="listen_name" value="<?php $_SESSION[SESS_USER_HOME]['username']?>">
	<div id="step1">
		<form role="form">
			<div class='div_border row'>
				<div class="col-xs-3 tag_name  " >学年</div>
				<div class="col-xs-9 tag_val ">
					<input type="text" placeholder="请输入学年" class="form-control" id="attend1" value='<?php if(isset($attend))echo $attend['academic_year'];?>'>
				</div>
			</div>
			<div  class='div_border row'>
				<div class="col-xs-3 tag_name  " >学期</div>
				<div class="col-xs-9 tag_val  " >
					<input type="text" placeholder="请输入学期" class="form-control" id="attend2" value='<?php if(isset($attend))echo $attend['semester'];?>'>
				</div>
			</div>
			<!-- <div  class='div_border row'>
				<div class="col-xs-3 tag_name  " >课程名称</div>
				<div class="col-xs-9 tag_val  " >
					<input type="text" placeholder="请输入课程名称" class="form-control" id="attend3" value="<?php if(isset($attend))echo $attend['class_name'];?>">
				</div>
			</div> -->
			<input type="hidden" id="attend3" value="<?php if(isset($attend))echo $attend['class_name']; if($class_name)echo $class_name?>" >
			<div  class='div_border row'>
				<div class="col-xs-3 tag_name   " >课程类别</div>
				<div class="col-xs-9 tag_val   " style="width: 200px">
					<!-- <div class="dropdown"> -->
						<!-- <input type="button" data-toggle="dropdown" id="attend4" class="dropdown_style form-control" value="请选择课程类别" /> -->
						<!-- <div class="dropdown-menu">-->
							<!-- <a class="dropdown-item" onclick="shows1($(this).text())">基础课</a>
							<a class="dropdown-item" onclick="shows1($(this).text())">专业基础课</a>
							<a class="dropdown-item" onclick="shows1($(this).text())">专业课</a> -->
							<select class='form-control' id="attend4">
								<option value="0" >请选择课程类别</option>
								<?php foreach ((new CourseName)->getAll() as $k=>$v): ?>
								<option value="<?php echo $v[XPHEnum::Value] ?>" <?php if(isset($attend)&&estr($attend, 'type')==$v[XPHEnum::Value]) echo 'selected="selected"' ?>><?php echo $v[XPHEnum::Caption] ?></option>
							<?php endforeach; ?>
						</select>
						
					<!-- </div> -->
				</div>
			</div>
			<!-- <div  class='div_border row'>
				<div class="col-xs-3 tag_name   " >授课教师</div>
				<div class="col-xs-9 tag_val   "  style="width: 280px">
					<input type="text" placeholder="请输入授课教师名称"  class="form-control" id="attend5" value="<?php if(isset($attend))echo $attend['teacher_name'];?>" >
				</div>
			</div>	 -->
			<input type="hidden" id="attend5" value="<?php if(isset($attend)){echo $attend['teacher_name'];} if($teacher_name) echo $teacher_name;?>">
			<div  class='div_border row'>
				<div class="col-xs-3 tag_name   " >职称</div>
				<div class="col-xs-9 tag_val   ">
					<!-- <div class="dropdown"> -->
						<input type="text" placeholder="请输入职称"  class="form-control" id="attend6" value="<?php if(isset($attend)) echo $attend['title'];?>">
						<!-- <input type="button" data-toggle="dropdown" id="attend6" class="dropdown_style form-control" value="请选择职称" />
						<div class="dropdown-menu">
							<a class="dropdown-item" onclick="shows2($(this).text())">讲师</a>
							<a class="dropdown-item" onclick="shows2($(this).text())">高级讲师</a>
							<a class="dropdown-item" onclick="shows2($(this).text())">副教授</a>
							<a class="dropdown-item" onclick="shows2($(this).text())">教授</a>
						</div> -->
						<!-- </div> -->
				</div>
			</div>
				<div  class='div_border row'>
					<div class="col-xs-5 tag_name   " >所属二级学院（部）</div>
					<div class="col-xs-9 tag_val   "  style="width: 200px">
						<input type="text" placeholder="所属二级学院（部）" class="form-control" id="attend7" value="<?php if(isset($attend))echo $attend['dept_name'];?>">
					</div>
				</div>
				<div  class='div_border row'>
					<div class="col-xs-3 tag_name   " >年龄层次</div>
					<div class="col-xs-9 tag_val   " style="width: 230px">
						<!-- <div class="dropdown"> -->
						<!-- <input type="button" data-toggle="dropdown" id="attend8" class="dropdown_style form-control" value="请选择教师年龄层次" />
						<div class="dropdown-menu">
							<a class="dropdown-item" onclick="shows3($(this).text())">老</a>
							<a class="dropdown-item" onclick="shows3($(this).text())">中</a>
							<a class="dropdown-item" onclick="shows3($(this).text())">青</a>
						</div> -->
						<select class='form-control' id="attend8">
							<option value="0" >请选择教师年龄层次</option>
							<?php foreach ((new AgeGroups)->getAll() as $k=>$v): ?>
							<option value="<?php echo $v[XPHEnum::Value] ?>" <?php if(isset($attend)&&estr($attend, 'type')==$v[XPHEnum::Value]) echo 'selected="selected"' ?>><?php echo $v[XPHEnum::Caption] ?></option>
						<?php endforeach; ?>
					</select>

					<!-- </div> -->
				</div>
			</div>
			<div  class='div_border row'>
				<div class="col-xs-3 tag_name  " >教师属性</div>
				<div class="col-xs-9 tag_val  " style="width: 200px">
						<select class='form-control' id="attend9" >
							<option value="0" >请选择教师属性</option>
							<?php foreach ((new TeachersAttribute)->getAll() as $k=>$v): ?>
							<option value="<?php echo $v[XPHEnum::Value] ?>" <?php if(isset($attend)&&estr($attend, 'type')==$v[XPHEnum::Value]) echo 'selected="selected"' ?>><?php echo $v[XPHEnum::Caption] ?></option>
						<?php endforeach; ?>
						</select>
					<!-- </div> -->
				</div>
			</div>
			<!-- <div  class='div_border row'>
				<div class="col-xs-3 tag_name  " >听课地点</div>
				<div class="col-xs-9 tag_val  " >
					<input type="text" placeholder="请输入听课地点" class="form-control" id="attend10" value="<?php if(isset($attend))echo $attend['dept_name'];?>">
				</div>
			</div> -->
			<input type="hidden" id="attend10" value="<?php if(isset($attend)){echo $attend['dept_name'];} if($class_room){echo $class_room;}?>">
			<!-- <div  class='div_border row'>
				<div class="col-xs-3 tag_name  " >开课单位</div>
				<div class="col-xs-9 tag_val  " >
					<input type="text" placeholder="请输入开课单位" class="form-control" id="attend11" value="<?php if(isset($attend))echo $attend['course_units'];?>">
				</div>
			</div> -->
			<input type="hidden" id="attend11" value="<?php if(isset($attend)){echo $attend['course_units'];}if($course_units){echo $course_units;}?>">
			<div  class='div_border row'>
				<div class="col-xs-3 tag_name  " >听课班级</div>
				<div class="col-xs-9 tag_val  " >
					<input type="text" placeholder="请输入听课班级" class="form-control" id="attend12" value="<?php if(isset($attend)){echo $attend['listen_class'];}if($class_room){echo $class_room;} ?>">
				</div>
			</div>
		</form>
		<div>	
			<input type="button" id="goto_step2" class="btn btn-primary step_default" onclick="nextStep()" value="下一步"></input>		
		</div>
	</div>

	
	
	<div id="step2" style="display: none;">
		<form class="role">
			<div>教学内容</div>
			<?php 
			if(isset($attend_teaching_content)){
				foreach ($attend_teaching_content as $k => $v) {					
					for($i=1;$i<=$attend_teaching_content[$k]['score'];$i++){
						$score[$i-1]=$i;
					}
					$question=(new TeachingContent)->show($k+1);
					$id=$k+1;
					echo "<div class='margin-bottom' ><div >".$id.".".$question."</div><select id='teachingLevel".$id."' class='selectpicker' >
					<option value='0'>请打分</option>";
					$select="";
					foreach ($score as $k2 => $v2) {						
						echo "<option value='".$v2."' class='form-control'>".$v2."</option>";
					}
					var_dump($v['get_score']);
					echo "</select></div><script>$('#teachingLevel".$id."').selectpicker('val', '".$v['get_score']."');</script>";
				}
			}
			?>
			<div>教学实施</div>
			<?php 
			if(isset($attend_teaching_implementation)){
				foreach ($attend_teaching_implementation as $k => $v) {					
					for($i=1;$i<=$attend_teaching_implementation[$k]['score'];$i++){
						$score[$i-1]=$i;
					}
					$question=(new TeachingImplementation)->show($k+1);
					$id=$k+4;
					echo "<div class='margin-bottom' ><div >".$id.".".$question."</div><select id='teachingLevel".$id."' class='selectpicker' >
					<option value='0'>请打分</option>";
					foreach ($score as $k2 => $v2) {
						echo "<option value='".$v2."' class='form-control'>".$v2."</option>";
					}
					echo "</select></div><script>$('#teachingLevel".$id."').selectpicker('val', '".$v['get_score']."');</script>";
				}
			}
			?>
		</form>
		<div>
			<input type="button" id="back_step1" class="btn btn-primary next_step" onclick="previousStep()" value="上一步">
			<input type="button" id="goto_step3" class="btn btn-primary next_step"onclick="nextStep()" value="下一步">		
		</div>
	</div>
	
	<div id="step3" style="display: none;">		
		<form class="role">
			<div>
				<div>学生状况</div>
				<?php 
				if(isset($attend_student_status)){
					foreach ($attend_student_status as $k => $v) {					
						for($i=1;$i<=$attend_student_status[$k]['score'];$i++){
							$score[$i-1]=$i;
						}
						$question=(new StudentStatus)->show($k+1);
						$id=$k+1;
						echo "<div class='margin-bottom' ><div >".$id.".".$question."</div><select id='teachingEffect".$id."' class='selectpicker' >
						<option value='0'>请打分</option>";
						foreach ($score as $k2 => $v2) {
							echo "<option value='".$v2."' class='form-control'>".$v2."</option>";
						}
						echo "</select></div><script>$('#teachingEffect".$id."').selectpicker('val', '".$v['get_score']."');</script>";
					}
				}
				?>	
			</div>
		</form>
		<div>
			<input type="button" id="back_step2" class="btn btn-primary next_step" onclick="previousStep()" value="上一步"></input>
			<input type="button" id="goto_step4" class="btn btn-primary next_step" onclick="nextStep()" value="下一步"></input>		
		</div>
	</div>

	<div id="step4" style="display: none;">
		<form class="role">
			<div>				
				<?php 
					if(isset($attend_teaching_readiness)){
						foreach ($attend_teaching_readiness as $k => $v) {			
							$item=$k+1;				
							echo "<div class='div_border1 div_float_left'>				
					<div class=' tag_name div_float_left 'style='width: 70px' >".$attend_teaching_readiness[$k]['item']."</div>
					<div class='div_float_left col-xs-3 tag_val' >";
							$option=explode(",",$attend_teaching_readiness[$k]['option']);
							foreach ($option as $k1 => $v1) {
								if($v['check_value']==$v1){
									$checked="checked";
								}else{
									$checked="";
								}
							 	echo "<div class='radio' style='float: left;margin-top: 5%'><label ><input name='item".$item."' ".$checked." type='radio' value='".$v1."' style='margin-left: -28px;margin-top: 2px' />".$v1."</label></div><div style='width:50px;height:50px' class='div_float_left'></div>";
							 } 
							 echo "</div></div>";
							 
						}
					}
				 ?>
				
			</div>
		</form>
		<input type="button" id="back_step3" class="btn btn-primary next_step" onclick="previousStep()" value="上一步"></input>
		<input type="button" id="goto_step5" class="btn btn-primary next_step" onclick="nextStep()" value="下一步"></input>
	</div> 

	<div id="step5" class="form-group" style="display: none;">		
		<form id="step5_form">
			<div>
				<?php 
					foreach ($attend_students_norm as $k => $v) {
						$item=$k+1;
						echo "<div class='div_border row'>
					<div class='col-xs-3 tag_name  ' >".$v['item']."</div>
					<div class='col-xs-9 tag_val  ' >
						<input type='text' placeholder='请输入".$v['item']."' id='studentsNorm".$item."' value='".$v['check_value']."'>
					</div>
				</div>";
					}
				 ?>
				<div class="div_border1 div_float_left">
					<div class=" tag_name  div_float_left" style="margin-left:3%;">课堂设施设备完好情况</div>
					<div class="div_float_left tag_val  "  style="">
						<div class="radio" style="float: left;margin-top: 5%">
							<label style=""><input name="item13" type="radio" value="1" style="margin-left: -16px;margin-top: 2px"  <?php if(isset($attend_classroom_facilities)&&$attend_classroom_facilities['check_value']==1)echo "checked";?>>好</label>
						</div>
						<div class="radio" style="margin-left: 30px;margin-top: -1%;float: left;">
							<label ><input name="item13" type="radio" value="2" style="margin-left: -16px;margin-top: 2px" <?php if(isset($attend_classroom_facilities) &&$attend_classroom_facilities['check_value']==2)echo "checked"; ?>>不好</label>
						</div>
					</div>
				</div>
				<div class="div_border1 div_float_left">
					<div class=" tag_name   div_float_left" style="margin-left:3%;">课堂环境卫生情况
					</div>
					<div class="div_float_left tag_val  " >
						<div class="radio" style="float: left;margin-top: 5%">
							<label style=""><input name="item14" type="radio" value="1" style="margin-left: -16px;margin-top: 2px" <?php if(isset($attend_classroom_environmental)&&$attend_classroom_environmental['check_value']==ClassroomEnvironmental::IsGood[XPHEnum::Value])echo "checked";?>><?php echo ClassroomEnvironmental::IsGood[XPHEnum::Caption] ?></label>
						</div>
						<div class="radio" style="margin-left: 30px;margin-top: -1%">
							<label ><input name="item14" type="radio" value="2" style="margin-left: -16px;margin-top: 2px;float: left;" <?php if(isset($attend_classroom_environmental)&&$attend_classroom_environmental['check_value']==ClassroomEnvironmental::IsGeneral[XPHEnum::Value])echo "checked";?>><?php echo ClassroomEnvironmental::IsGeneral[XPHEnum::Caption] ?></label>
						</div>
						<div class="radio" style="float: left;margin-left: 30px;margin-top: -1%;float: left;">
							<label ><input name="item14" type="radio" value="4" style="margin-left: -16px;margin-top: 2px;float: left;" <?php if(isset($attend_classroom_environmental)&&$attend_classroom_environmental['check_value']==ClassroomEnvironmental::IsBad[XPHEnum::Value])echo "checked";?>><?php echo ClassroomEnvironmental::IsBad[XPHEnum::Caption] ?></label>
						</div>
					</div>				
				</div>
			</div>

		</form>
		<div>
			<input type="button" id="back_step4" class="btn btn-primary next_step" onclick="previousStep()" value="上一步"></input>
			<input type="button" id="goto_step6" class="btn btn-primary next_step" onclick="nextStep()"value="下一步"></input>		
		</div>
	</div>


	<div id="step6" class="form-group" style="display: none">
		<button style="float: left;" id="add_record">添加记录</button>
		<div class="clear"></div>
		<form id="step6_form">
			<?php 
				if($is_add!=0){
					foreach ($attend_record as $k => $v) {
						if(isset($attend_record)){
						echo "<div class='content'>
				<div class='div_border row'>
					<div class='col-xs-2 tag_name ' >时间</div>
					<div class='col-xs-9 tag_val '  >
						<input type='text' disabled='value'  class='form-control time_HMS write' id='recordid1' value='".$attend_record[$k]['time']."'' >
					</div>
				</div>
				<div class='div_border' style='height: auto!important;'>
					<div class='div_border row'>
						<div class='col-xs-3 tag_name  ' >教学活动</div>
						<div class='col-xs-9 tag_val '>
							<input type='text' placeholder='请输入教学活动' class='form-control write' id='recordid2' value='".$attend_record[$k]['activity']."'>
						</div>
					</div>
					<div class='div_border row'>
						<div class='col-xs-3 tag_name  ' >随堂评注</div>
						<div class='col-xs-9 tag_val '>
							<input type='text' placeholder='请输入教学活动' class='form-control write' id='recordid3' value='".$attend_record[$k]['commentary']."'>
						</div>
					</div>
				</div>
			</div>";
					}
				}
				}else{
					echo "<div class='content'>
				<div class='div_border row'>
					<div class='col-xs-2 tag_name ' >时间</div>
					<div class='col-xs-9 tag_val '  >
						<input type='text' disabled='value'  class='form-control time_HMS write' id='recordid1' >
					</div>
				</div>
				<div class='div_border' style='height: auto!important;'>
					<div class='div_border row'>
						<div class='col-xs-3 tag_name  ' >教学活动</div>
						<div class='col-xs-9 tag_val '>
							<input type='text' placeholder='请输入教学活动' class='form-control write' id='recordid2'>
						</div>
					</div>
					<div class='div_border row'>
						<div class='col-xs-3 tag_name  ' >随堂评注</div>
						<div class='col-xs-9 tag_val '>
							<input type='text' placeholder='请输入教学活动' class='form-control write' id='recordid3' >
						</div>
					</div>
				</div>
			</div>";
				}
			 ?>

			<!-- <div id="content">
				<div class='div_border row'>
					<div class="col-xs-2 tag_name " >时间</div>
					<div class="col-xs-9 tag_val "  >
						<input type="text" disabled="value"  class="form-control time_HMS write" id="recordid1" >
					</div>
				</div>
				<div class='div_border' style="height: auto!important;">
					<div class='div_border row'>
						<div class="col-xs-3 tag_name  " >教学活动</div>
						<div class="col-xs-9 tag_val ">
							<input type="text" placeholder="请输入教学活动" class="form-control write" id="recordid2" value="<?php if(isset($attend_record))echo $attend_record[0]['activity']; ?>">
						</div>
					</div>
					<div class='div_border row'>
						<div class="col-xs-3 tag_name  " >随堂评注</div>
						<div class="col-xs-9 tag_val ">
							<input type="text" placeholder="请输入教学活动" class="form-control write" id="recordid3" value="<?php if(isset($attend_record))echo $attend_record[0]['commentary']; ?>">
						</div>
					</div>
				</div>
			</div> -->
			<div id="img_upload">
				<ul class="upload-ul clearfix">
					<?php 
						if(isset($attend_img)){
							foreach ($attend_img as $k => $v) {
								$file = $v['img']; 
								if($fp = fopen($file,"rb", 0)) 
								{ 
								    $gambar = fread($fp,filesize($file)); 
								    fclose($fp); 
								 
								     
								    $base64 = chunk_split(base64_encode($gambar)); 
								    // 输出
								    $encode = "data:image/jpg/png/gif;base64," . $base64; //完整点的
								}
								echo "<li id='fileBox_WU_FILE_0' class='diyUploadHover'>
									<div class='viewThumb'>					    
										<input type='hidden'>					    
										<div class='diyBar'> 							
											<div class='diyProgress'>0%</div> 					    
										</div> 					    
										<p class='diyControl'><span class='diyLeft'><i></i></span>
											<span class='diyCancel'><i></i></span>
											<span class='diyRight'><i></i></span>
										</p>
										<img src='".$encode."'>
									</div>
								</li>";
							}
						}
					 ?>
					<li class="upload-pick">
						<div class="webuploader-container clearfix" id="Upload"><div class="webuploader-pick webuploader-pick-hover"></div><div id="rt_rt_1dfpj0lt21pse1nlu1lgl1fjr1nfk1" style="position: absolute; top: 0px; left: 0px; width: 120px; height: 90px; overflow: hidden; bottom: auto; right: auto;"><input type="file" name="file" class="webuploader-element-invisible" multiple="multiple" accept=""><label style="opacity: 0; width: 100%; height: 100%; display: block; cursor: pointer; background: rgb(255, 255, 255);"></label></div></div>
					</li>
				</ul>
			</div>


		</form>	
		<input type="button" id="back_step5" class="btn btn-primary next_step" onclick="previousStep()" value="上一步"></input>
		<input type="button" id="submit" class="btn btn-primary next_step" value="提交"></input>
	</div>


</div>
</body>
</html>